Optimal. Leaf size=20 \[ -\frac {\tanh ^{-1}(\cos (x))}{a}+\frac {\cos (x)}{a+a \sin (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2826, 3855,
2727} \begin {gather*} \frac {\cos (x)}{a \sin (x)+a}-\frac {\tanh ^{-1}(\cos (x))}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2727
Rule 2826
Rule 3855
Rubi steps
\begin {align*} \int \frac {\csc (x)}{a+a \sin (x)} \, dx &=\frac {\int \csc (x) \, dx}{a}-\int \frac {1}{a+a \sin (x)} \, dx\\ &=-\frac {\tanh ^{-1}(\cos (x))}{a}+\frac {\cos (x)}{a+a \sin (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(74\) vs. \(2(20)=40\).
time = 0.04, size = 74, normalized size = 3.70 \begin {gather*} -\frac {\left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \left (\cos \left (\frac {x}{2}\right ) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )+\left (2+\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right ) \sin \left (\frac {x}{2}\right )\right )}{a (1+\sin (x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 21, normalized size = 1.05
method | result | size |
default | \(\frac {\frac {2}{\tan \left (\frac {x}{2}\right )+1}+\ln \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) | \(21\) |
norman | \(\frac {2}{a \left (\tan \left (\frac {x}{2}\right )+1\right )}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) | \(24\) |
risch | \(\frac {2}{\left ({\mathrm e}^{i x}+i\right ) a}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{a}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{a}\) | \(42\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.39, size = 31, normalized size = 1.55 \begin {gather*} \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} + \frac {2}{a + \frac {a \sin \left (x\right )}{\cos \left (x\right ) + 1}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 53 vs.
\(2 (20) = 40\).
time = 0.40, size = 53, normalized size = 2.65 \begin {gather*} -\frac {{\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 2 \, \cos \left (x\right ) + 2 \, \sin \left (x\right ) - 2}{2 \, {\left (a \cos \left (x\right ) + a \sin \left (x\right ) + a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\csc {\left (x \right )}}{\sin {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 24, normalized size = 1.20 \begin {gather*} \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{a} + \frac {2}{a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.42, size = 23, normalized size = 1.15 \begin {gather*} \frac {2}{a\,\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}+\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________